/*
 * @Description:
 * @Version:
 * @Author: Troubadour
 * @Date: 2022-09-10 10:41:24
 * @LastEditors: Troubadour
 * @LastEditTime: 2022-09-12 12:42:46
 */

#ifndef  __INFRARED_H__
#define  __INFRARED_H__

#include "main.h"
#include "tim.h"
#include "dma.h"
#include "robotservofw.h"
#include "usart.h"

#define  Delay_us_Func(n)               TIME_Delay_us(n)
#define  Delay_ms_Func(n)               TIME_Delay_ms(n)
#define  ReadPin(port, pin)             HAL_GPIO_ReadPin(port, pin)

#define  Infrared_Up                    (0x00FF46B9)
#define  Infrared_Down                  (0x00FF15EA)
#define  Infrared_Left                  (0x00FF44BB)
#define  Infrared_Right                 (0x00FF43BC)
#define  Infrared_Ok                    (0x00FF40BF)
#define  Infrared_Key1                  (0x00FF16E9)
#define  Infrared_Key2                  (0x00FF19E6)
#define  Infrared_Key3                  (0x00FF0DF2)
#define  Infrared_Key4                  (0x00FF0CF3)
#define  Infrared_Key5                  (0x00FF18E7)
#define  Infrared_Key0                  (0x00FF52AD)
#define  Infrared_T1                    (0x00FF42BD)
#define  Infrared_T2                    (0x00FF4AB5)


extern uint32_t InfraredData;
extern volatile uint8_t InfraredFlg;

HAL_StatusTypeDef Read_Infrared(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t *data);

#endif  /*  __INFRARED_H__  */
